package com.limbo.showapp.presenter;

import com.limbo.showapp.base.BasePresenter;
import com.limbo.showapp.bean.BannerBean;
import com.limbo.showapp.bean.RegisterBean;
import com.limbo.showapp.model.RegisterModel;
import com.limbo.showapp.rxHttp.HttpObserver;
import com.limbo.showapp.view.IHttpView;

/**
 * Created by wangqi on 2018/9/12.
 */

public class RegisterPresenter extends BasePresenter<IHttpView,RegisterModel> {
    @Override
    protected RegisterModel getModel() {
        return new RegisterModel();
    }

    public void register(String iden){
        mModel.register(iden, new HttpObserver<RegisterBean>() {
            @Override
            protected void onHttpError(Throwable e) {
                if (getView() != null)
                    getView().onError(e.getMessage());
            }

            @Override
            protected void onHttpSuccess(RegisterBean bean) {
                if (getView() != null)
                    getView().onSuccess(bean);
            }
        });
    }
}
